﻿#region Using
using System;
using System.ServiceModel;
using SilverCrmSoap.CrmSdk;

#endregion

namespace Linq2Crm
{
	public class ConnectionProvider
	{
		public ConnectionProvider(Uri serviceUri)
		{
			Uri = serviceUri;
		}

		protected Uri Uri { get; set; }

		public IOrganizationService CreateCrmConnection()
		{
			return SilverCrmSoap.Helpers.SoapHelper.SoapClient.ChannelFactory.CreateChannel(new EndpointAddress(Uri.ToString()));
		}
	}
}